<template>
    <el-container>
        <el-header >
                <el-tabs v-model="activeName" @tab-click="handleClick" >
                    <el-tab-pane label="登录" name="登录">
                    </el-tab-pane>
                    <el-tab-pane label="注册" name="注册">
                    </el-tab-pane>
                </el-tabs>
        </el-header>
        <el-main>
            <router-view></router-view>
        </el-main>
        <el-footer v-if="this.$route.path === '/login' || this.$route.path==='/register'">
            全国高职院校Web应用软件开发技能竞赛
        </el-footer>
    </el-container>
</template>

<script>
export default {
    name:'Login',
    data(){
        return {
            activeName: '登录',
            flag:true
        }
    },
    methods: {
      handleClick(tab, event) {
        tab.name === '登录' ? this.$router.push('/login') : this.$router.push('/register')
      }
    },
    mounted(){
        console.log(this.$router,'mounted')
    },
    beforeDestroy(){
        console.log(this.$router,'beforeDestroy')
    }
}
</script>

<style scoped>
.el-container{
    position: relative;
    height: 100%;
}
.el-header{
    padding: 0px;
}
.el-tabs{
    float: right;
    padding: 0 20px;
    line-height: 61px;
    height: 61px;
}
.el-main{
    margin: 0px;
    padding: 0px;
}
.el-footer{
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #bfa;
    text-align: center;
    line-height: 50px;
}
</style>